package com.kfm.am.stream;

import java.util.*;
import java.util.stream.Collectors;

public class Demo05 {

    public static void main(String[] args) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("小羊", "2023-09-20");
        hashMap.put("小猪", "2023-09-19");
        hashMap.put("小牛", "2019-09-11");
        hashMap.put("小鸡", "2023-09-13");
        // 跟据日期提醒用户哪些人今天过生日？
        Set<Map.Entry<String, String>> entries = hashMap.entrySet();
        //
//        Set<Map.Entry<String, String>> set = entries.stream().filter(v -> {
//            // v key "人名" value "日期字符串"
//            return DateUtils.isBirthToday(v.getValue());
//        }).collect(Collectors.toSet());
//        System.out.println(set);
        entries.stream().filter(v->DateUtils.isBirthSevenDay(v.getValue())).forEach(e -> System.out.println(e));
    }
}
